import FleeAtkUp from "../module/x_ability/FleeAtkUp"
import FleeMpr from "../module/x_ability/FleeMpr"
import GDefAtkUp from "../module/x_ability/GDefAtkUp"
import GDefHpr from "../module/x_ability/GDefHpr"
import GDefMpr from "../module/x_ability/GDefMpr"
import RebArrowAtkUp from "../module/x_ability/RebArrowAtkUp"
import RebArrowFireBall from "../module/x_ability/RebArrowFireBall"
import { XAbilityClassConstructor } from "../types/lbase"
import { XAbilityExclusive, XAbilityTrgType } from "../types/L_Type"


export type XAbilityAttr={
  name:string,
  /**触发类型 */
  trgType:XAbilityTrgType,
  /**触发系数  x% */
  trgProb:number,
  /**通常是指同类触发中  不同强度的类型的强度值  例如 pdefMp100,pdefMp1  完美防御触发回蓝100,1  */
  weight:number,
  /**特效专属属性 需要才配置*/
  exclusiveAttr?:XAbilityExclusive,
  /**X能力的实现类 */
  impClass:XAbilityClassConstructor
}


export  type XAbilityTypeKey= keyof typeof XAbilityConfig



//不想二次定义key  就只能接收value 泛型缺失的问题<string,XAbilityAttr>  暂时这样
export const XAbilityConfig={
  pdefMp1:{
    name:'完美防御回蓝1',
    trgType:'god_def',
    weight:1,
    trgProb:100,
    impClass:GDefMpr
  },
  pdefHp1:{
    name:'完美防御回血1',
    trgType:'god_def',
    weight:1,
    trgProb:100,
    impClass:GDefHpr
  },
  fleeMp1:{
    name:'闪避回蓝1',
    trgType:'flee',
    weight:3,
    trgProb:100,
    impClass:FleeMpr
  },
  fleeAtkUp1:{
    name:'回避加攻击2秒108点',
    trgType:'flee',
    weight:108,
    trgProb:100,
    impClass:FleeAtkUp,
    exclusiveAttr:{
      lastedTime:2
    }
  },
  pdefAtkUp1:{
    name:'完美防御加攻击2秒105点',
    trgType:'god_def',
    weight:105,
    trgProb:100,
    impClass:GDefAtkUp,
    exclusiveAttr:{
      lastedTime:2
    }
  },
  rArrowAtkUp1:{
    name:'弹反箭矢加攻击3秒200点',
    trgType:'rebound_arrow',
    weight:200,
    trgProb:100,
    impClass:RebArrowAtkUp,
    exclusiveAttr:{
      lastedTime:3
    }
  },
  rArrowFireBall:{
    name:'弹反箭矢生成火球',
    trgType:'rebound_arrow',
    weight:0,
    trgProb:100,
    impClass:RebArrowFireBall
  },

}
